home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Plug-In Power Pack for Netscape Communicator
/
Plug-In Power Pack for Netscape Communicator.iso
/
plugins
/
dataviews
/
dvtools
/
demos
/
citydemo
/
c4i_vars.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-05-08
|
6KB
|
210 lines
/*------------------------------------------------------------------
| file name -- vars.h
|-----------------------------------------------------------------*/
/* REFERENCE the global variables for DISPLAY */
extern CHAR *DeviceName;
/* REFERENCE the global variables for the main DISPLAY */
extern DRAWPORT ActiveDrawport;
extern DRAWPORT CalculatingDp[];
extern RECTANGLE Pvp_screen[]; /* popup virtual coords. */
extern RECTANGLE Pvp_drawing[]; /* " world " */
extern RECTANGLE Pdd_scr_coords[]; /* " screen " */
/*for Zoom Management */
extern RECTANGLE PortSize[];
extern RECTANGLE MaxVp;
extern INT ZoomeD; /* 0 = no zoom dp, 1 = zoom dp */
extern DV_BOOL ZoomToActive; /* 0 = no zoom to, 1 = zoom to */
struct _ZOOM_INFO
{
FLOAT *hscroll, *vscroll;
DOUBLE zscale;
DV_POINT zcenter;
DRAWPORT manipdp;
OBJECT msgstr;
};
extern struct _ZOOM_INFO ZoomInfo;
#define OF_ZOOMED_VIEW 1
#define OF_UNZOOMED_VIEW 0
#define ZOOM_FACTOR 1.5
#define MAX_ZOOM 11.0
#define MIN_ZOOM 0.08
#define YFUDGE_ll 3600
#define YFUDGE_ur 3600
/* names of important objects in zoom view */
#define AREA_FOR_ZOOM "view.area"
#define HORIZ_SCROLLER "y7::horz_scroll"
#define VERTICAL_SCROLLER "y8::vert_scroll"
#define MSG_STRING "MessageString"
/* REFERENCE global variables for managing windows */
#define NUM_WINDOWS 2 /* Main and Control. */
extern INT ActiveScreenIndex;
extern OBJECT DVscreen[];
extern DRAWPORT Drawport[];
extern CHAR *WindowName[];
extern DV_POINT WindowSize[], WindowPos[];
extern SYMTABLE
DpTable, /* table for Room DRAWPORT management */
ViewTable; /* table for overlay VIEW management */
#define VTABLE_LEN 10 /* Initial length of ViewTable. */
#define DPTABLE_LEN 25 /* Initial length of DPTable. */
#define NUM_VU_PRELOAD 3 /* map and top,help, zoom views. */
/* and... */
#define NUM_POPUP_DP 2 /* One for traffic trends, One for Civil */
/* vehicles' occupants and id. */
#define POPUP_TX_STR "P_CLASS" /* id's the popup class in the view. */
#define NUM_OVERLAYS 4
typedef struct PRELOAD_VIEW
{
CHAR *name; /* name of view */
DV_BOOL CreateStretch; /* use TdpCreateStretch() to create? */
} PRELOAD_VIEW;
extern PRELOAD_VIEW
PreldView[]; /* Preloaded view files. */
extern CHAR
*SamplePopupVu[]; /* Sample view for each Pop Up Dp. */
/* Define a structure that will keep track of display lists */
typedef struct DISPLAY_LIST
{
DRAWPORT drawport;
DV_BOOL overlays[NUM_OVERLAYS];
DRAWPORT PopupDp[NUM_POPUP_DP];
OBJECT PopupLite[NUM_POPUP_DP];
FLOAT *PopupDBuf[NUM_POPUP_DP];
INT zoomed;
struct DISPLAY_LIST *prev;
} DISPLAY_LIST;
extern DISPLAY_LIST *DisplayList; /* Pointer to list of Displays */
/* REFERENCE global variables for CONTROL FLOW */
extern DV_BOOL ApplicationState; /* exit application or not? */
extern DV_BOOL HelpNotActive; /* NO, when help view is displayed.*/
/* CONSTANTS */
#define WAIT_VIEW "intro.v" /* view for preloading views */
#define MAP_VIEW "nhamp.v"
#define HELP_VIEW "bighelp.v"
#define CONTROL_VIEW "controls.v" /* view button controls */
#define ZOOM_VIEW "dp_manip.v" /* view of zoom template */
#define CALCULATING_DP_VIEW "calcview.v"
#define DEFAULT_SIZE (RECTANGLE*)NULL
#define DEFAULT_PORTION (RECTANGLE*)NULL
/* Display Manager flags */
#define RUNNING 1 /* active state of application */
#define NOT_RUNNING 0 /* inactive state of application */
#define RESET_DISPLAY 0
#define NEXT_DISPLAY 1
#define PREV_DISPLAY 2
#define NEXT_CONTROL 3
/* The following four are used to identify overlays */
/* and their associated Popups. */
#define BUS_ROUTES 3
#define TRAFFIC 1
#define AT_WORK 2
#define CIVIL_PATROLS 0
/* control how Popups are redrawn. */
#define DRAW YES
#define REDRAW NO
/* Name of invisible objects that will not need redrawing. */
#define INVISIBLE 'I'
/* control view table */
#define ADD YES
#define NO_ADD NO
/* control window creation. */
#define STRETCH YES
#define NO_STRETCH NO
/* Control overlay dsl characteristics. */
#define DONT_MERGE_DSLs 0
#define PLEASE_MERGE_DSLs 1
/* Hot Spot Names */
#define QUIT_COMMAND 'Q'
#define OVERLAY_COMMAND 'O'
#define MAIN_W_OLAY_TOGGLE 'v'
#define REPLACE_OVERLAY_COM 'o'
#define o_OVERLAY '1'
#define o_DELETE '2'
#define DELETE_COMMAND 'D'
#define C4I_HELP_COMMAND 'h'
#define START_HELP '1'
#define END_HELP '2'
#define ZOOM_COMMAND 'Z'
#define ZOOM_SUB_COMMAND 'z'
#define ZOOM_SCROLLER_COM 'y'
#define ZOOM_IN '1'
#define ZOOM_OUT '2'
#define ZOOM_TO '3'
#define Z_PAN '4'
#define Z_RESET '5'
#define Z_QUIT '6'
#define FLIP_COMMAND 'F'
#define REFRESH_MAIN 'r'
#define COMSIGN ':'
/* Pick EVENT Types */
#define HOT_SPOT_EVENT 'H'
#define BUTTON_EVENT 'B'
#define Z_VSCROLLER_EVENT 'v'
#define Z_HSCROLLER_EVENT 'h'
/* Window Types */
#define MAIN_WINDOW 0
#define CONTROL_WINDOW 1
/* MISC MACROs */
#define STRINGS_ARE_EQUAL( str1, str2 ) strcmp( str1, str2 ) == 0
/* ERROR MESSAGE MACROs */
#define EXIT_IF_INVALID( a, string ) if( !a ) \
{ (VOID)printf(string); \
exit(EXIT_ERR);}
#define EXIT2_IF_INVALID( a, s1, s2 ) if( !a ) \
{ (VOID)printf("%s%s\n",s1, s2); \
exit(EXIT_ERR);}
#define RETURN_IF_INVALID( a, string ) if( !a ) \
{ (VOID)printf(string); return a;}
#define RETURN2_IF_INVALID(a, s1, s2 ) if (!a) \
{(VOID)printf( s1,s2);}
#define NO_DEVICE "DataViews environment variable DVDEVICE must be defined.\n"
#define NO_MAP_VIEW "Map View can't be loaded.\n"
#define NO_CONTROL_VIEW "Control View can't be loaded.\n"
#define UNKOWN_DRAWPORT "No view for specified object name.\n"